package com.hzqy.web.login;

import java.util.Observable;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 分辨率，1：标清、2：高清
 * @author dead
 *
 */
public class ResolutionSession extends ObserverFather {
	private static final Log LOG = LogFactory.getLog(ResolutionSession.class);
	
	public ResolutionSession(HttpServletRequest request) {
		super(request);
	}

	@Override
	public void update(Observable o, Object arg) {
		super.update(o, arg);
		if(epgInfoVo != null){
			int resolution = 1;
			if(epgInfoVo.getPage_url() != null) {
				if(epgInfoVo.getPartner().toLowerCase().indexOf("hd") != -1)
					resolution = 2;
				if(epgInfoVo.getPage_url().toLowerCase().indexOf("hd") != -1)
					resolution = 2;
				//此处为广电应急分组模板，统一要求进入标清页面，但分组名称中出现了hd标识，所以需要特殊处理。
				if(epgInfoVo.getPage_url().toLowerCase().indexOf("gdhddisaster") != -1)
					resolution = 1;
			}
			session.setAttribute(SessionKey.SESSION_EPG_RESOLUTION, resolution+"");
		}
	}
}
